/**
 * ProductionPlanningService.java
 * 2008-3-13
 * @author 屈甲康qujiakang@gmail.com
 */
package org.jackysoft.service;

import java.io.File;
import java.io.IOException;
import java.util.Collection;

import org.jackysoft.data.IDataProvider;
import org.jackysoft.entity.Department;
import org.jackysoft.entity.MonthPlanning;
import org.jackysoft.entity.MonthPlanningItem;
import org.jackysoft.util.FileInfo;
import org.joda.time.DateTime;
import org.springframework.dao.DataAccessException;

/**
 * @author Administrator
 * 
 */
public interface ArmMonthlyPlanService extends IDataProvider<String,MonthPlanning>{

	/**
	 * 某个产品截止本年本月的计划量
	 * 
	 * */
	Double valueToCurrent(int year ,int month,String code)  throws DataAccessException;
		
	/**
	 * 按年月取得计划
	 * */
	Collection<MonthPlanning> find(int year,int month) throws DataAccessException;
	
	Collection<MonthPlanning> find(int year,int month,int day) throws DataAccessException;
	
	
	/**
	 * 按年月取得计划
	 * */
	Collection<MonthPlanning> find(int year,int month,Department dept) throws DataAccessException;
	

	FileInfo download(DateTime actionDate) throws DataAccessException, IOException;
	/**
	 * 删除月计划
	 * */
	void remove(int year,int month)  throws DataAccessException;
	/**
	 * 更新某年某月的计划
	 * */
	void update(int year,int month, MonthPlanning mtemp) throws DataAccessException;			
	
	/**
	 * 从servet流导入所指定年月的计划
	 * 流代表一个xls格式的数据流
	 * */
	void importPlanning(int year,int month,int day) throws DataAccessException;
	
	void importPlanning(DateTime actionDate) throws DataAccessException;
	
	void importPlanning(File plan,DateTime actionDate) throws DataAccessException;	
	
	Collection<MonthPlanningItem> getsChildrenItem(MonthPlanningItem  month) throws DataAccessException;	
	
	void refresh() throws DataAccessException;
	
	Collection<MonthPlanning> gets(int page,int rows,Department dept) throws DataAccessException;
	

}
